package com.wjk.Demo04;

class Animal {
    public void eat(){
        System.out.println("动物吃饭");
    }
}
class Cat extends Animal{
    public void eat(){
        System.out.println("猫吃鱼");
    }
}
public class Test01{
    public static void main(String[] args) {
        Cat c=new Cat();
        Animal a=new Cat();
        c.eat();
        a.eat();
    }
}
